package metalink.admin;
import com.opensymphony.xwork2.ActionSupport;
import java.util.*;
import java.sql.*;

import vo.*;
import vo.mixed.*;
import model.admin.*;
import myutil.*;
public class Message_Degree_Batch extends ActionSupport{
	ArrayList<BatchDetailsVo> batches_list=new ArrayList<BatchDetailsVo>();
	ArrayList<StudentDetailsVo> student_list=new ArrayList<StudentDetailsVo>();
	public ArrayList<StudentDetailsVo> getStudent_list() {
		return student_list;
	}
	public void setStudent_list(ArrayList<StudentDetailsVo> student_list) {
		this.student_list = student_list;
	}
	public ArrayList<BatchDetailsVo> getBatches_list() {
		return batches_list;
	}
	public void setBatches_list(ArrayList<BatchDetailsVo> batches_list) {
		this.batches_list = batches_list;
	}
public String execute(){
	try {
		
		Connect c=new Connect();
		ResultSet rs=c.getResult("select * from batch_details");
	
		while(rs.next())
		{
		BatchDetailsVo single_object=new BatchDetailsVo();
	//	single_object.setStart_year("");
		single_object.setBatch_name(rs.getString("batch_name"));
		single_object.setBatch_id(rs.getInt("batch_id"));
		batches_list.add(single_object);
		}
		ResultSet rs1=c.getResult("select * from student_details");
		
		
		while(rs1.next()){
			StudentDetailsVo single_object=new StudentDetailsVo();
			single_object.setEmail_id(rs1.getString("email_id"));
			single_object.setStudent_name(rs1.getString("student_name"));
			student_list.add(single_object);
		}
		return SUCCESS;
				} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
		return ERROR;
	}
	
}
}
